package com.sishuok.annotation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

@Service
public class UserService {
	
	@Autowired
	ApplicationEventPublisher applicationEventPublisher;
	
	public void register(String username) {
		System.out.println("用户：" + username + "注册成功！");
		
		applicationEventPublisher.publishEvent(new UserRegisterEvent(username));
	}

}
